package org.subatu.orm.query.base;

import org.subatu.orm.util.ChkUtil;

/**
 * 条件枚举
 */
public enum CondEnum {

    and("and"),
    or("or"),
    boxL("("),
    boxR(")"),

    lt("<"),
    le("<="),
    gt(">"),
    ge(">="),
    eq("="),
    like("like"),
    likeL("like"),
    likeR("like"),
    isNull("is null"),
    notNull("is not null"),

    in("in"),
    notIn("not in");


    private String value;

    private CondEnum(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    // 拼接sql 的时候,不需要加 value 的
    public boolean notValue() {
        if (ChkUtil.in(this, and, or, boxL, boxR, isNull, notNull)) {
            return true;
        }
        return false;
    }
}
